<?php

include ("../singleton/SDB.class.php");

function user_exist($username, $password)
{
  $instance = SDB::getInstance();
  $query = $instance->query("SELECT * FROM `users` WHERE `username` = \"$username\" AND `password` = \"$password\"");
  $res = $query->fetch();
  return ($res);
}

function add_user_in_base($username, $password, $right)
{
  SDB::getInstance()->query("INSERT INTO `users`(`username`, `password`, `right`) VALUES (\"$username\", \"$password\", \"$right\")");
}

?>